import React,{Component} from 'react'

export default function isLogin(Com){
    return class High extends Component{
        render(){
            this.$httpReq(this.$api.IS_LOGIN_IN(),res=>{
               
                console.log('用户'+localStorage.user+'登录成功')
                
            },msg=>{
                this.props.history.push('/login')
                console.log('您还没有登录哦，请登录后继续访问')
                
            })
           
            return <div className="isLogin">
                {  
                    localStorage.user?<Com {...this.props}/>:<div>您还没有登录哦</div>
                }
             </div>
            
        }
    }
}

